home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
oper_sys
/
quartz
/
quartz10.lha
/
include
/
quartzcommon.h
< prev
next >
Wrap
C/C++ Source or Header
|
1990-04-29
|
3KB
|
126 lines
/* Data structures shared between the Quartz pre-processor, runtime, and
* post-processor
*/
/* Basic defines */
#ifndef NUMPROCS
#define NUMPROCS 20 /* max we allow */
#endif
#ifndef ACCURACY
#define ACCURACY float
#endif
#ifndef NULL
#define NULL 0
#endif
#ifndef FALSE
#define FALSE 0
#define TRUE 1
#endif
#define MaxEffectiveParallelism (NUMPROCS)
#define MaxNominalParallelism (NUMPROCS * 2)
typedef ACCURACY FLOAT;
/* Enumerations */
/* Well-known procedure ids -- shared between pre-processor and runtime */
/* 0 is taken */
#define StartID 1
#define IdleID 2
#define ForkID 3
#define InitProcs 4
/* Kinds of synchronization objects */
#define VarSpinLock 0
#define VarSpinDependency 1
#define VarBlockLock 2
#define VarBlockDependency 3
#define VarThread 4
#define VarProcedure 5 /* for post-processor */
/* thread states */
#define BUSY 0
#define SPIN 1
#define BLOCKED 2
#define READY 3
#define NumStates 4
/* types of profiling data */
#define MePlusKids 0
#define JustMe 1
#define NumWho 2
/* Maximum number of queue lengths sampled per synchronization object */
#define NumNumbers 2
/* The shared data structures between runtime and post-processor */
typedef struct busy_data {
FLOAT byEffP[MaxEffectiveParallelism];
} BusyData;
typedef struct nominal_data {
FLOAT byNomP[NumWho][NumStates][2]; /* nomP >= P ? */
} NominalData;
typedef struct queue_length {
FLOAT length[NumNumbers][MaxNominalParallelism];
} QueueLength;
/* Actual data structures passed from runtime to post-processor
* DO NOT CHANGE, without changing dump.c
*/
typedef struct measured_data {
BusyData busy;
NominalData nom;
QueueLength queue;
} MeasuredData;
/* Procedure data -- names come from munge */
typedef struct proc_data {
int id;
MeasuredData meas;
} ProcData;
/* Synchronization object data -- names come from user */
typedef struct synch_data {
char *name;
int kind;
int myID;
int parentID;
int hit;
MeasuredData meas;
} SynchData;
/* busy time propagated upward from this child */
typedef struct KidData {
int callerID;
int calleeID;
BusyData busy;
} KidData;
/* traditional call-graph */
typedef struct triple {
int calleeID;
int callerID;
int num;
} Triple;
typedef struct quartz_data {
int numProcessors;
int numProcIds;
FLOAT timeDiff;
int numSamples;
ProcData *procData;
int numProcs;
SynchData *synchData;
int numSynch;
KidData *kidData;
int numKids;
Triple *triples;
int numTriples;
} QuartzData;